TARGET  := aaig
SRCS    := aaig.cpp program.cpp instruction.cpp ISA.cpp
INCLUDE	:= program.h instruction.h ISA.h helper.h	
OBJS    := ${SRCS:.cpp=.o} 


CCFLAGS = -O2 -Wall -Werror
LDFLAGS = 
LIBS    = 
CC 	= g++
CCARM	= gcc-arm

all:: ${TARGET}

${TARGET}: ${OBJS} ${INCLUDE}
	${CC} ${LDFLAGS} -o $@ $^ ${LIBS} 

${OBJS}: %.o: %.cpp
	${CC} ${CCFLAGS} -o $@ -c $< 

${DEPS}: %.dep: %.cpp Makefile 
	${CC} ${CCFLAGS} -MM $< > $@ 

clean:: 
	-rm -f *~ *.o ${TARGET} 

%.out: %.S
	$(CCARM) -static $< -o $*.out

distclean:: clean
